/* 重置样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f5f6fa;
  color: #333;
  line-height: 1.5;
}

/* 容器样式 */
.popup-container {
  width: 360px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

/* 头部样式 */
.popup-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo svg {
  fill: white;
}

.popup-header h1 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

/* 内容区域 */
.popup-content {
  padding: 20px;
}

/* 状态区域 */
.status-section {
  margin-bottom: 24px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #28a745;
}

.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #28a745;
  position: relative;
}

.status-indicator.inactive {
  background: #dc3545;
}

.status-indicator.checking {
  background: #ffc107;
}

.status-indicator::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: inherit;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

#status-text {
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

/* 操作按钮区域 */
.action-section {
  margin-bottom: 24px;
}

.action-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #333;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.action-btn.primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.action-btn.primary:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.action-btn.secondary {
  background: #f8f9fa;
  color: #333;
  border: 1px solid #e9ecef;
}

.action-btn.secondary:hover {
  background: #e9ecef;
  border-color: #dee2e6;
}

.action-btn svg {
  fill: currentColor;
}

/* 模板区域 */
.template-section {
  margin-bottom: 24px;
}

.template-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #333;
}

.template-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.template-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e9ecef;
  transition: all 0.2s ease;
  cursor: pointer;
}

.template-item:hover {
  background: #e9ecef;
  border-color: #dee2e6;
  transform: translateX(2px);
}

.template-info {
  flex: 1;
}

.template-name {
  font-size: 13px;
  font-weight: 500;
  color: #333;
  margin-bottom: 2px;
}

.template-desc {
  font-size: 11px;
  color: #666;
}

.template-use {
  background: #667eea;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.template-use:hover {
  background: #5a67d8;
}

.template-loading,
.template-error {
  text-align: center;
  padding: 20px;
  color: #666;
  font-size: 13px;
  font-style: italic;
}

.template-error {
  color: #dc3545;
}

/* 设置区域 */
.settings-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #333;
}

.setting-item {
  margin-bottom: 12px;
}

.setting-item label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  position: relative;
  padding-left: 30px;
  user-select: none;
}

.setting-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 18px;
  width: 18px;
  background-color: #f8f9fa;
  border: 2px solid #dee2e6;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.setting-item label:hover input ~ .checkmark {
  background-color: #e9ecef;
  border-color: #ced4da;
}

.setting-item input:checked ~ .checkmark {
  background-color: #667eea;
  border-color: #667eea;
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.setting-item input:checked ~ .checkmark:after {
  display: block;
}

/* 底部样式 */
.popup-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
}

.version {
  font-size: 12px;
  color: #999;
  font-weight: 500;
}

.links {
  display: flex;
  gap: 12px;
}

.links a {
  font-size: 12px;
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.links a:hover {
  color: #5a67d8;
  text-decoration: underline;
}

/* 滚动条样式 */
.template-list::-webkit-scrollbar {
  width: 4px;
}

.template-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 2px;
}

.template-list::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 2px;
}

.template-list::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 响应式调整 */
@media (max-width: 400px) {
  .popup-container {
    width: 320px;
  }
  
  .popup-header {
    padding: 16px;
  }
  
  .popup-content {
    padding: 16px;
  }
  
  .action-buttons {
    gap: 6px;
  }
  
  .action-btn {
    padding: 10px 14px;
    font-size: 13px;
  }
} 